package cn.shopthrive.merchants;

import android.content.Context;
import android.util.Log;

import com.heytap.msp.push.mode.DataMessage;
import com.heytap.msp.push.service.DataMessageCallbackService;

import java.util.HashMap;
import java.util.Map;

public class OppoPushService extends DataMessageCallbackService {
  private static final String TAG = "OppoPushService";

  @Override
  public void processMessage(Context context, DataMessage message) {
    super.processMessage(context, message);
    Log.i(TAG, "Received OPPO push message: " + message.toString());
    Map<String, Object> data = new HashMap<>();
    data.put("messageId", String.valueOf(message.getMessageID()));
    data.put("title", message.getTitle());
    data.put("content", message.getContent());
    data.put("skipContent", message.getDescription());
    MyApplication app = (MyApplication) context.getApplicationContext();
    app.notifyPushMessage(context, data);
  }
}
